﻿using System;
using System.Windows.Media.Imaging;
using Plugins.Base.Common;
using Plugins.Core;
using StockModel;
using TrixPlugin.Historical;
using Utils;
using StockAccessors;

[assembly: PluginContainerAssembly]

namespace TrixPlugin
{
	public class TrixPlugin : PluginBase
	{
		#region Properties

		public override bool SupportsRealtime
		{
			get
			{
				return false;
			}
		}

		#endregion

		#region Public Methods

		public TrixPlugin()
		{
			base.VisualRepresentation = new VisualRepresentation(new BitmapImage(new Uri(@"pack://application:,,,/TrixPlugin;component/Resources/ToolBar.ico")), "Trix Strategy");
		}

		public override void Initialize(IDataBaseClient databaseClient, QuotationDataSource quotationDataSource, ExchangeMarketDataSource exchangeMarketDataSource, RawStockDataSource rawStockDataSource, ObservableCollection2<StockGroup> realtimeGroups, IOrderExecutor executor, IStockDataAccessorInformation accessorInformation)
		{
			base.HistoricalEngine = new HistoricalEngineParallel(quotationDataSource, rawStockDataSource);
			base.HistoricalControlPanel = new ControlPanel() { DataContext = new ControlPanelVM(rawStockDataSource, (HistoricalEngineParallel)base.HistoricalEngine) };
		}

		#endregion
	}
}
